home *** CD-ROM | disk | FTP | other *** search
/ Over 1,000 Windows 95 Programs / Over 1000 Windows 95 Programs (Microforum) (Disc 1).iso / 1271 / selfline.bas < prev    next >
BASIC Source File  |  1996-08-18  |  1KB  |  47 lines

  1. Option Explicit
  2.  
  3. Function GoOnline (ByVal ThePort As Integer) As Integer
  4.   Dim I As Integer
  5.   Dim Code As Integer
  6.   'open the port
  7.   Code = SioReset(ThePort, 1024, 1024)
  8.   If Code < 0 Then
  9.     Call SayError(SELFTEST, Code)
  10.     GoOnline = 0
  11.     Exit Function
  12.   End If
  13.   Code = SioBaud(ThePort, Baud38400)
  14.   SELFTEST.Print "*** COM"; LTrim$(Str$(1 + ThePort)); " ready ";
  15.   'set DTR & RTS
  16.   Code = SioDTR(ThePort, Asc("S"))
  17.   Code = SioRTS(ThePort, Asc("S"))
  18.   ' set parms
  19.   Code = SioParms(ThePort, NoParity, OneStopBit, WordLength8)
  20.   Code = SioRxClear(ThePort)
  21.   Code = SioTxClear(ThePort)
  22.   GoOnline = 1
  23. End Function
  24.  
  25. Sub ShowCaption ()
  26.   Dim A As String
  27.   Dim B As String
  28.   A = "COM" + LTrim$(Str$(1 + The1stPort))
  29.   B = "COM" + LTrim$(Str$(1 + The2ndPort))
  30.   SELFTEST.Caption = "SelfTest: " + A + " ===> " + B
  31. End Sub
  32.  
  33. Sub ShowConfig ()
  34.   Dim Version As Integer
  35.   Version = SioInfo(Asc("V"))
  36.   SELFTEST.Print "*** SELFTEST 1.0"
  37.   SELFTEST.Print "*** WSC Version ";
  38.   SELFTEST.Print LTrim$(Str$(Version \ 16)) + ".";
  39.   SELFTEST.Print LTrim$(Str$(Version Mod 16))
  40. End Sub
  41.  
  42. Sub ShutDown ()
  43. Dim Code As Integer
  44.   Code = SioDone(The1stPort)
  45.   Code = SioDone(The2ndPort)
  46. End Sub
  47.